﻿<baseview:BaseView x:Class="CharacterCreation.Views.RaceDetailView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:baseview="clr-namespace:CharacterCreation.Views.Contracts"             
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:helpers="clr-namespace:CharacterCreation.Contracts"
    xmlns:controls="clr-namespace:CharacterCreation.Controls"
    mc:Ignorable="d"
    d:DesignHeight="691" d:DesignWidth="846">

    <Grid x:Name="LayoutRoot" Margin="10">

        <Grid.Resources>
            <Style TargetType="TextBlock">
                <Setter Property="Foreground" Value="{Binding ForegroundBrush}" />
                <Setter Property="Margin" Value="5" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>
            <Style TargetType="TextBox">
                <Setter Property="Margin" Value="5" />
                <Setter Property="HorizontalAlignment" Value="Left" />
            </Style>
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="3*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <TextBlock Text="Name:"  Grid.Column="0" Grid.Row="0" />
        <TextBox Text="{Binding Race.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" Grid.Row="0" Height="24" 
                 HorizontalAlignment="Stretch"/>


        <Grid Grid.Row="1" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="1*" />
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="1*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <TextBlock Text="Strength bonus:" Margin="5" Grid.Column="0" Grid.Row="0" />
            <TextBox Text="{Binding Race.StrengthBonus}" Grid.Column="1" Grid.Row="0" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Dexterity bonus:" Margin="5" Grid.Column="0" Grid.Row="1" />
            <TextBox Text="{Binding Race.DexterityBonus}" Grid.Column="1" Grid.Row="1" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Fighting bonus:" Margin="5" Grid.Column="0" Grid.Row="2" />
            <TextBox Text="{Binding Race.FightingBonus}" Grid.Column="1" Grid.Row="2" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Constitution bonus:" Margin="5" Grid.Column="0" Grid.Row="3" />
            <TextBox Text="{Binding Race.ConstitutionBonus}" Grid.Column="1" Grid.Row="3" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Perception bonus:" Margin="5" Grid.Column="0" Grid.Row="4" />
            <TextBox Text="{Binding Race.PerceptionBonus}" Grid.Column="1" Grid.Row="4" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Intelligence bonus:" Margin="5" Grid.Column="2" Grid.Row="0" />
            <TextBox Text="{Binding Race.IntelligenceBonus}" Grid.Column="3" Grid.Row="0" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Will power bonus:" Margin="5" Grid.Column="2" Grid.Row="1" />
            <TextBox Text="{Binding Race.WillPowerBonus}" Grid.Column="3" Grid.Row="1" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Charisma bonus:" Margin="5" Grid.Column="2" Grid.Row="2" />
            <TextBox Text="{Binding Race.CharismaBonus}" Grid.Column="3" Grid.Row="2" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Hit points bonus:" Margin="5" Grid.Column="2" Grid.Row="3" />
            <TextBox Text="{Binding Race.HitPointsBonus}" Grid.Column="3" Grid.Row="3" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />

            <TextBlock Text="Essence bonus:" Margin="5" Grid.Column="2" Grid.Row="4" />
            <TextBox Text="{Binding Race.EssenceBonus}" Grid.Column="3" Grid.Row="4" Height="24" IsEnabled="True" Width="60" HorizontalContentAlignment="Center" />
        </Grid>

        <TextBlock Text="Description:" Margin="5" Grid.Column="0" Grid.Row="2" />
        <ToolBar Grid.Column="1" Grid.Row="2">
            <ToggleButton MinWidth="40"
                Command="EditingCommands.ToggleBold" 
                CommandTarget="{Binding ElementName=rtb}"
                TextBlock.FontWeight="Bold">B</ToggleButton>
        </ToolBar>
        <controls:MyRichTextBox Text="{Binding Race.Description, Mode=TwoWay}"  Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="3" 
                 ScrollViewer.VerticalScrollBarVisibility="Auto" AcceptsReturn="True" HorizontalAlignment="Stretch"  x:Name="rtb"/>

        <!--Text="{Binding Race.Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  TextWrapping="Wrap"-->
    </Grid>
</baseview:BaseView>
